home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / GDIDIB.PAK / DIBUTIL.H < prev    next >
Text File  |  1997-05-06  |  1KB  |  36 lines

  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright (C) 1993 - 1995  Microsoft Corporation.  All Rights Reserved.
  7. //
  8. // PURPOSE:
  9. //    Contains declarations for DIB-related functions in dibutil.c
  10. //    These routines are taken from the WINCAP32 sample
  11.  
  12. #define PALVERSION            0x300
  13. #define HDIB                  HANDLE           // handle to a DIB
  14. #define IS_WIN30_DIB(lpbi)    ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
  15. #define RECTWIDTH(lpRect)     ((lpRect)->right - (lpRect)->left)
  16. #define RECTHEIGHT(lpRect)    ((lpRect)->bottom - (lpRect)->top)
  17.  
  18. // WIDTHBYTES performs DWORD-aligning of DIB scanlines.  The "bits"
  19. // parameter is the bit count for the scanline (biWidth * biBitCount),
  20. // and this macro returns the number of DWORD-aligned bytes needed 
  21. // to hold those bits.
  22. #define WIDTHBYTES(bits)      ((((bits) + 31) & ~31) >> 3)
  23.  
  24. // Function prototypes
  25. HPALETTE CreateDIBPalette(HDIB);
  26. void DIBError(int);
  27. DWORD DIBHeight(LPSTR);
  28. WORD DIBNumColors(LPSTR);
  29. LPSTR FindDIBBits(LPSTR);
  30. WORD PaletteSize(LPSTR);
  31. WORD SaveDIB(HDIB, LPVOID, LPSTR);
  32. BOOL PaintBitmap (HDC, LPRECT, HBITMAP, LPRECT, HPALETTE); 
  33. int  FillColorTable(HWND, LPRGBQUAD, HPALETTE, int);
  34.  
  35.  
  36.